<template>
  <div class="item">
    <div class="left">
      <img :src="articleItem.picture[0]" alt="" />
    </div>
    <div class="right">
      <nuxt-link
        :to="{
          name: 'guide-guideDetails-id',
          query: { articleId: articleItem.id },
        }"
      >
        <span class="titleColor curp">{{ articleItem.title }}</span>
      </nuxt-link>
      <span class="tips">{{ articleItem.description }} </span>
      <div class="bot">
        <span class="tips time">{{ articleItem.update_time }}</span>
        <span class="tips"
          ><span class="el-icon-view"></span> {{ articleItem.hits }}</span
        >
      </div>
    </div>
  </div>
</template>
<script>
export default {
  components: {},
  props: {
    articleItem: {
      type: Object,
      default: () => {
        return {};
      },
    },
  },
  data() {
    return {};
  },
  methods: {},
};
</script>

<style scoped lang='scss'>
.item {
  width: 100%;
  display: flex;
  align-items: center;
  background-color: #fff;
  border-radius: 4px;
  margin-bottom: 30px;

  .left {
    width: 170px;
    height: 118px;
    margin-right: 16px;
    flex-shrink: 0;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }
  }

  .right {
    display: flex;
    flex-direction: column;
    flex-grow: 1;

    .titleColor {
      font-size: 18px;
    }

    .tips {
      overflow: hidden;
      text-overflow: ellipsis;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      display: -webkit-box;
      max-height: 50px;
      font-size: 14px;
      line-height: 26px;
      margin-top: 10px;
    }

    .bot {
      display: flex;
      align-items: center;
      font-size: 12px;

      .time {
        margin-right: 10px;
      }
    }
  }
}
</style>